package org.zoomdev.zoom.common.caster;

import org.zoomdev.zoom.aop.Setter;

public class ToValueFastCaster {
    private final Setter setter;

    private final ValueCaster caster;

    private final String name;

    public ToValueFastCaster(Setter setter, ValueCaster caster, String name) {
        this.setter = setter;
        this.caster = caster;
        this.name = name;
    }

    public void set(Object target, Object value) {
        value = caster.to(value);
        setter.set(target, value);
    }
}
